#pragma once

struct AVDATA
{
	AVDATA() { media=0; size=0;}
	virtual ~AVDATA(){}
	int			media;
	DWORD		codec;
	int			size;
	FILETIME	ft;
	AVDATA	*	next;
};


struct AUDIODATA : public AVDATA
{
	AUDIODATA() { media = 2; size=0; }
	BYTE	data[2048];
	SYSTEMTIME	st;
};

struct VIDEODATA : public AVDATA
{
	VIDEODATA() { media = 1; pData=0; size=0; }
	virtual ~VIDEODATA() 
	{
		if(pData != 0)
		{
			delete[] pData;
			pData = 0;
		}
	}
	BYTE		* pData;
	SYSTEMTIME	st;
	int			frame_type;
	void Set( BYTE * data, int n ) { pData= new BYTE[n]; size = n; memcpy( pData, data, n); }
};

struct FRAMEDATA : public AVDATA
{
	FRAMEDATA() { media = 1; pData=0; size=0; width=0; height=0; Y = 0; U = 0; V = 0; strideY = 0;}
	virtual ~FRAMEDATA() { 
		if(pData != 0)
		{
			delete[] pData; 
			pData = 0;
		}
	}
	BYTE		* pData;
	SYSTEMTIME	st;
	int			frame_type;
	int			width;
	int			height;
	int			strideY;
	void Set( BYTE * data, int n ) { pData= new BYTE[n]; size = n; memcpy( pData, data, n); }
	BYTE	* Y;
	BYTE	* U;
	BYTE	* V;
};
